# $Id: PKGBUILD 182399 2013-04-10 05:34:09Z pierre $
# Maintainer: Pierre Schmitz <pierre@archlinux.de>

# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
#  - patches to fix issues with how we use the tools

pkgname=devtools-alarm
_pkgname=devtools
pkgver=20150228
pkgrel=1
pkgdesc='Tools for Arch Linux ARM package maintainers'
arch=('any')
license=('GPL')
url='http://projects.archlinux.org/devtools.git/'
conflicts=('devtools')
provides=('devtools')
depends=('namcap' 'openssh' 'subversion' 'rsync' 'arch-install-scripts')
source=("https://sources.archlinux.org/other/$_pkgname/$_pkgname-$pkgver.tar.gz"
        '0001-makechrootpkg-cache-dir.patch'
        '0002-arch-nspawn-keep-mirrorlist.patch'
        '0003-makechrootpkg-distcc.patch'
        '0004-arch-nspawn-arm-fix.patch'
        '0005-makechrootpkg-no-default-logging.patch'
        '0006-archbuild-no-setarch.patch')
md5sums=('4b17a83dac3f8c93de85acebd0a90a16'
         '9e70b777886ec0af1a787b32c7444ed8'
         'd6ff97c5dcc0cbfbe65ec3cc3ae495f7'
         '9bb4797d676a56437a5ed130ce202e68'
         '14c261c1d0139888a2fb10cb9bbfda37'
         '2af8e8b30dbc22d5a0f3ddfcaecf64fa'
         '97ed4af62c8020fe6f7f991f930fb68e')

prepare() {
	cd "${_pkgname}-${pkgver}"
	patch -p1 -i ../0001-makechrootpkg-cache-dir.patch
	patch -p1 -i ../0002-arch-nspawn-keep-mirrorlist.patch
	patch -p1 -i ../0003-makechrootpkg-distcc.patch
	patch -p1 -i ../0004-arch-nspawn-arm-fix.patch
	patch -p1 -i ../0005-makechrootpkg-no-default-logging.patch
	patch -p1 -i ../0006-archbuild-no-setarch.patch
}

build() {
	cd "${_pkgname}-${pkgver}"
	make PREFIX=/usr
}

package() {
	cd "${_pkgname}-${pkgver}"
	make PREFIX=/usr DESTDIR=${pkgdir} install
}
